<table>	
	<table search="unit">
		<variables>
			<var_l_lower_arm value="0"/>
			<var_l_upper_arm value="0"/>
			<var_l_lower_leg value="0"/>
			<var_l_upper_leg value="0"/>
			<var_r_lower_arm value="0"/>
			<var_r_upper_arm value="0"/>
			<var_r_lower_leg value="0"/>
			<var_r_upper_leg value="0"/>
			<var_head value="0"/>
			<var_enemy_head_var value="0"/>
			<var_enemy_gadgets_var value="0"/>			
			<var_ragdoll_enabled value="0"/>
			<var_halloween_2017 value="0"/>
			<var_l_upper_arm_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/l_upper_arm_debris'"/>
			<var_l_lower_arm_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/l_lower_arm_debris'"/>
			<var_r_upper_arm_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/r_upper_arm_debris'"/>
			<var_r_lower_arm_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/r_lower_arm_debris'"/>
			<var_l_upper_leg_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/l_upper_leg_debris'"/>
			<var_l_foot_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/l_foot_debris'"/>
			<var_r_upper_leg_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/r_upper_leg_debris'"/>
			<var_r_foot_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/r_foot_debris'"/>
			<var_head_debris value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/head_debris'"/>
			<var_head_debris_1 value="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_gasmask/debris/head_debris'"/>
		</variables>

		<filter name="'check_not_halloween_not_gasmask'">
			<check value="vars.var_enemy_head_var < 2"/>
			<check value="vars.var_halloween_2017 == 0"/>	
		</filter>		
		
		<filter name="'check_not_halloween_not_gasmask_intact_head'">
			<check value="vars.var_enemy_head_var < 2"/>
			<check value="vars.var_head == 0"/>			
			<check value="vars.var_halloween_2017 == 0"/>	
		</filter>	

		<filter name="'check_head_sg'">
			<check value="vars.var_enemy_head_var == 1"/>
			<check value="vars.var_halloween_2017 == 0"/>
		</filter>		

		<filter name="'check_gasmask'">
			<check value="vars.var_enemy_head_var == 2"/>
			<check value="vars.var_halloween_2017 == 0"/>	
		</filter>		
	
		<filter name="'check_not_halloween_ragdoll'">
			<check value="vars.var_ragdoll_enabled == 0"/>
			<check value="vars.var_halloween_2017 == 0"/>			
		</filter>
		
		<filter name="'check_gadgets_stg'">
			<check value="vars.var_enemy_gadgets_var == 1"/>
		</filter>
		
		<filter name="'check_gadgets_sg_and_rifle'">
			<check value="vars.var_enemy_gadgets_var == 2"/>
		</filter>		

		<sequence editable_state="true" name="'spawn_helmet'" once="true" triggable="true">
			<graphic_group name="'hat_grp'" visibility="false"/>
			<body enabled="false" name="'hit_helmet'"/>
			<decal_mesh enabled="false" name="'c_convex_helmet'" start_time="10/30"/>
			<decal_mesh enabled="false" name="'dm_gasmask'" start_time="10/30"/>
			<spawn_unit name="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/helmet_debris'" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 200 * rand(), 200 * rand() )"/>
			
			<object filter="'check_head_sg'" enabled="false" name="'g_mask'"/>
			<object filter="'check_head_sg'" enabled="false" name="'g_mask_lod1'"/>
			<object filter="'check_head_sg'" enabled="false" name="'g_mask_lod2'"/>				
			<spawn_unit filter="'check_head_sg'" name="'units/vanilla/characters/enemies/models/german_black_waffen_sentry_heavy/debris/mask_debris'" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 200 * rand(), 200 * rand() )"/>			
		</sequence>

		<sequence editable_state="true" name="'gadget_meat_grinder'" triggable="true" once="true">	
			<!-- sg -->
			<object filter="'check_head_sg'" enabled="true" name="'g_mask'"/>
			<object filter="'check_head_sg'" enabled="true" name="'g_mask_lod1'"/>
			<object filter="'check_head_sg'" enabled="true" name="'g_mask_lod2'"/>
			<decal_mesh filter="'check_head_sg'" enabled="true" name="'c_convex_mask'" />	

			<object filter="'check_head_sg'" enabled="true" name="'g_german_helmet_m35_black_sg'"/>
			<object filter="'check_head_sg'"enabled="true" name="'g_german_helmet_m35_black_sg_lod1'"/>
			<object filter="'check_head_sg'" enabled="true" name="'g_german_helmet_m35_black_sg_lod2'"/>	
			
			<object filter="'check_head_sg'" enabled="false" name="'g_german_helmet_m35_black'"/>
			<object filter="'check_head_sg'" enabled="false" name="'g_german_helmet_m35_black_lod1'"/>
			<object filter="'check_head_sg'" enabled="false" name="'g_german_helmet_m35_black_lod2'"/>					
			
			<!-- rifle/ar shared gadgets -->
			<object filter="'check_gadgets_sg_and_rifle'" enabled="true" name="'g_rif_hipgadgets'"/>
			<object filter="'check_gadgets_sg_and_rifle'" enabled="true" name="'g_rif_hipgadgets_lod1'"/>
			<object filter="'check_gadgets_sg_and_rifle'" enabled="true" name="'g_rif_hipgadgets_lod2'"/>	
			
			<!-- smg -->
			<object filter="'check_gadgets_smg'" enabled="true" name="'g_smg_hipgadgets'"/>
			<object filter="'check_gadgets_smg'" enabled="true" name="'g_smg_hipgadgets_lod1'"/>
			<object filter="'check_gadgets_smg'" enabled="true" name="'g_smg_hipgadgets_lod2'"/>	
			
			<!-- ar -->
			<object filter="'check_gadgets_stg'" enabled="true" name="'g_stg_hipgadgets'"/>
			<object filter="'check_gadgets_stg'" enabled="true" name="'g_stg_hipgadgets_lod1'"/>
			<object filter="'check_gadgets_stg'" enabled="true" name="'g_stg_hipgadgets_lod2'"/>	
			
			<decal_mesh filter="'check_gasmask'" enabled="true" name="'dm_gasmask'" />
			
			<object filter="'check_gasmask'" enabled="true" name="'g_gasmask'"/>
			<object filter="'check_gasmask'" enabled="true" name="'g_gasmask_lod1'"/>
			<object filter="'check_gasmask'" enabled="true" name="'g_gasmask_lod2'"/>	
		</sequence>						
		
		<sequence editable_state="true" name="'shotgunner'" once="true" triggable="true">
			<set_variables var_enemy_gadgets_var="2"/>
			<set_variables var_enemy_head_var="1"/>
			
			<run_sequence name="'gadget_meat_grinder'"/>		
		</sequence>				
		
		<sequence editable_state="true" name="'ar'" once="true" triggable="true">
			<set_variables var_enemy_head_var="2"/>
			<set_variables var_enemy_gadgets_var="1"/>
			
			<run_sequence name="'gadget_meat_grinder'"/>
		</sequence>
		
		<sequence editable_state="true" name="'ar_dnau'" once="true" triggable="true">		
			<set_variables var_enemy_gadgets_var="1"/>
			
			<run_sequence name="'gadget_meat_grinder'"/>
		</sequence>

		<sequence editable_state="true" name="'rifleman'" once="true" triggable="true">		
			<set_variables var_enemy_gadgets_var="2"/>

			<run_sequence name="'gadget_meat_grinder'"/>
		</sequence>		
		
		<sequence editable_state="true" name="'dismember_head_no_blood'" triggable="true">
			<object enabled="true" name="'g_neck_meat'"/>
			<set_variables var_head="1"/>
			<run_sequence name="'toggle_body_parts'" />
			<run_sequence filter="'check_ragdoll_enabled'" name="'switch_to_ragdoll'" start_time="2/30"/>
			<run_sequence name="'toggle_hit_box'" start_time="2/30"/>
			<graphic_group enabled="false" name="'head_pumpkin_grp'"/>
			<object enabled="false" name="'g_pumpkin_head'"/>
			<object enabled="false" name="'g_pumpkin_head_lod1'"/>
			<object enabled="false" name="'g_pumpkin_head_lod2'"/>
		</sequence>

		<sequence editable_state="true" name="'dismember_head'" triggable="true">
			<run_sequence name="'dismember_head_no_blood'"/>
			<run_sequence filter="'check_not_halloween_not_gasmask'" name="'spawn_helmet'"/>
			
			<body filter="'check_gasmask'" enabled="false" name="'hit_helmet'"/>
			<decal_mesh filter="'check_gasmask'" enabled="false" name="'c_convex_helmet'" />			
			<decal_mesh filter="'check_gasmask'" enabled="false" name="'dm_gasmask'" />			
			
			<effect filter="'check_not_halloween_2017'" name="'effects/vanilla/dismemberment/dis_blood_spray_001'" parent="object( 'Neck' )" position="v()"/>
			<effect filter="'check_halloween_2017'" name="'effects/event_001_halloween/impacts/imp_orange_sparks_001'" parent="object( 'Neck' )" position="v()"/>
			
			<function extension="'spawn_manager'" filter="'check_not_halloween_not_gasmask'" function="'spawn_character_debris'" param1="'dismember_head'" param2="'Head'" param3="vars.var_head_debris" param4="1"/>
			<function extension="'spawn_manager'" filter="'check_gasmask'" function="'spawn_character_debris'" param1="'dismember_head'" param2="'Head'" param3="vars.var_head_debris_1" param4="1"/>
		</sequence>
		
		<sequence editable_state="true" name="'toggle_body_parts'" triggable="true">
			<graphic_group name="'char_grp'" visibility="false"/>
			<graphic_group filter="'check_hidden_head'" name="'hat_grp'" visibility="false"/>
			<graphic_group filter="'check_not_halloween_not_gasmask'" name="'head_grp'" visibility="false"/>
			<object enabled="false" name="'s_body'"/>
			<object enabled="true" filter="'check_not_halloween_not_gasmask_intact_head'" name="'g_dsm_head'"/>
			<object enabled="false" filter="'check_halloween_2017'" name="'g_dsm_head'"/>
			<object enabled="true" filter="'check_intact_l_lower_arm'" name="'g_dsm_l_arm_lower'"/>
			<object enabled="true" filter="'check_intact_l_upper_arm'" name="'g_dsm_l_arm_upper'"/>
			<object enabled="true" filter="'check_intact_r_upper_arm'" name="'g_dsm_r_arm_upper'"/>
			<object enabled="true" filter="'check_intact_r_lower_arm'" name="'g_dsm_r_arm_lower'"/>
			<object enabled="true" name="'g_dsm_body'"/>
			<object enabled="true" filter="'check_intact_l_lower_leg'" name="'g_dsm_l_leg_lower'"/>
			<object enabled="true" filter="'check_intact_l_upper_leg'" name="'g_dsm_l_leg_upper'"/>
			<object enabled="true" filter="'check_intact_r_lower_leg'" name="'g_dsm_r_leg_lower'"/>
			<object enabled="true" filter="'check_intact_r_upper_leg'" name="'g_dsm_r_leg_upper'"/>
			<object enabled="true" filter="'check_intact_head'" name="'s_dsm_head'"/>
			<object enabled="true" filter="'check_intact_l_lower_arm'" name="'s_dsm_l_arm_lower'"/>
			<object enabled="true" filter="'check_intact_l_upper_arm'" name="'s_dsm_l_arm_upper'"/>
			<object enabled="true" filter="'check_intact_r_upper_arm'" name="'s_dsm_r_arm_upper'"/>
			<object enabled="true" filter="'check_intact_r_lower_arm'" name="'s_dsm_r_arm_lower'"/>
			<object enabled="true" name="'s_dsm_body'"/>
			<object enabled="true" filter="'check_intact_l_lower_leg'" name="'s_dsm_l_leg_lower'"/>
			<object enabled="true" filter="'check_intact_l_upper_leg'" name="'s_dsm_l_leg_upper'"/>
			<object enabled="true" filter="'check_intact_r_lower_leg'" name="'s_dsm_r_leg_lower'"/>
			<object enabled="true" filter="'check_intact_r_upper_leg'" name="'s_dsm_r_leg_upper'"/>
			<object enabled="false" filter="'check_hidden_head'" name="'g_dsm_head'"/>
			<graphic_group filter="'check_hidden_head'" name="'head_grp'" visibility="false"/>						
			<object enabled="false" filter="'check_hidden_l_lower_arm'" name="'g_dsm_l_arm_lower'"/>
			<object enabled="false" filter="'check_hidden_l_upper_arm'" name="'g_dsm_l_arm_upper'"/>
			<object enabled="false" filter="'check_hidden_r_upper_arm'" name="'g_dsm_r_arm_upper'"/>
			<object enabled="false" filter="'check_hidden_r_lower_arm'" name="'g_dsm_r_arm_lower'"/>
			<object enabled="false" filter="'check_hidden_l_lower_leg'" name="'g_dsm_l_leg_lower'"/>
			<object enabled="false" filter="'check_hidden_l_upper_leg'" name="'g_dsm_l_leg_upper'"/>
			<object enabled="false" filter="'check_hidden_r_lower_leg'" name="'g_dsm_r_leg_lower'"/>
			<object enabled="false" filter="'check_hidden_r_upper_leg'" name="'g_dsm_r_leg_upper'"/>
			<object enabled="false" filter="'check_hidden_head'" name="'s_dsm_head'"/>
			<object enabled="false" filter="'check_hidden_l_lower_arm'" name="'s_dsm_l_arm_lower'"/>
			<object enabled="false" filter="'check_hidden_l_upper_arm'" name="'s_dsm_l_arm_upper'"/>
			<object enabled="false" filter="'check_hidden_r_upper_arm'" name="'s_dsm_r_arm_upper'"/>
			<object enabled="false" filter="'check_hidden_r_lower_arm'" name="'s_dsm_r_arm_lower'"/>
			<object enabled="false" filter="'check_hidden_l_lower_leg'" name="'s_dsm_l_leg_lower'"/>
			<object enabled="false" filter="'check_hidden_l_upper_leg'" name="'s_dsm_l_leg_upper'"/>
			<object enabled="false" filter="'check_hidden_r_lower_leg'" name="'s_dsm_r_leg_lower'"/>
			<object enabled="false" filter="'check_hidden_r_upper_leg'" name="'s_dsm_r_leg_upper'"/>
		</sequence>		
				
		<sequence editable_state="true" name="'switch_to_ragdoll'" triggable="true">
			<set_variables var_ragdoll_enabled="1"/>
			<!-- <graphic_group filter="'check_not_halloween_not_gasmask'" name="'hat_grp'" visibility="false"/>			 -->
			<body filter="'check_not_halloween_not_gasmask'" enabled="false" name="'hit_helmet'"/>
			<decal_mesh filter="'check_not_halloween_not_gasmask'" enabled="false" name="'c_convex_helmet'" />			
			<decal_mesh filter="'check_not_halloween_not_gasmask'" enabled="false" name="'dm_gasmask'" />			
			<body enabled="true" name="'rag_Spine'"/>
			<body enabled="true" name="'rag_Spine1'"/>
			<body enabled="true" name="'rag_Spine2'"/>
			<body enabled="true" name="'rag_Hips'"/>
			<body enabled="true" filter="'check_intact_l_upper_leg'" name="'rag_LeftUpLeg'"/>
			<body enabled="true" filter="'check_intact_r_upper_leg'" name="'rag_RightUpLeg'"/>
			<body enabled="true" filter="'check_intact_l_lower_leg'" name="'rag_LeftLeg'"/>
			<body enabled="true" filter="'check_intact_r_lower_leg'" name="'rag_RightLeg'"/>
			<body enabled="true" filter="'check_intact_l_lower_arm'" name="'rag_LeftForeArm'"/>
			<body enabled="true" filter="'check_intact_r_lower_arm'" name="'rag_RightForeArm'"/>
			<body enabled="true" filter="'check_intact_l_upper_arm'" name="'rag_LeftArm'"/>
			<body enabled="true" filter="'check_intact_r_upper_arm'" name="'rag_RightArm'"/>
			<body enabled="true" filter="'check_intact_head'" name="'rag_Head'"/>
			<body enabled="false" filter="'check_hidden_l_upper_leg'" name="'rag_LeftUpLeg'"/>
			<body enabled="false" filter="'check_hidden_r_upper_leg'" name="'rag_RightUpLeg'"/>
			<body enabled="false" filter="'check_hidden_l_lower_leg'" name="'rag_LeftLeg'"/>
			<body enabled="false" filter="'check_hidden_r_lower_leg'" name="'rag_RightLeg'"/>
			<body enabled="false" filter="'check_hidden_l_lower_arm'" name="'rag_LeftForeArm'"/>
			<body enabled="false" filter="'check_hidden_r_lower_arm'" name="'rag_RightForeArm'"/>
			<body enabled="false" filter="'check_hidden_l_upper_arm'" name="'rag_LeftArm'"/>
			<body enabled="false" filter="'check_hidden_r_upper_arm'" name="'rag_RightArm'"/>
			<body enabled="false" filter="'check_hidden_head'" name="'rag_Head'"/>
			<constraint enabled="true" name="'Spine'"/>
			<constraint enabled="true" name="'Spine1'"/>
			<constraint enabled="true" name="'Spine2'"/>
			<constraint enabled="true" filter="'check_intact_l_upper_leg'" name="'LeftUpLeg'"/>
			<constraint enabled="true" filter="'check_intact_r_upper_leg'" name="'RightUpLeg'"/>
			<constraint enabled="true" filter="'check_intact_l_lower_leg'" name="'LeftLeg'"/>
			<constraint enabled="true" filter="'check_intact_r_lower_leg'" name="'RightLeg'"/>
			<constraint enabled="true" filter="'check_intact_l_lower_arm'" name="'LeftForeArm'"/>
			<constraint enabled="true" filter="'check_intact_r_lower_arm'" name="'RightForeArm'"/>
			<constraint enabled="true" filter="'check_intact_l_upper_arm'" name="'LeftArm'"/>
			<constraint enabled="true" filter="'check_intact_r_upper_arm'" name="'RightArm'"/>
			<constraint enabled="true" filter="'check_intact_head'" name="'Head'"/>
			<constraint enabled="false" filter="'check_hidden_l_upper_leg'" name="'LeftUpLeg'"/>
			<constraint enabled="false" filter="'check_hidden_r_upper_leg'" name="'RightUpLeg'"/>
			<constraint enabled="false" filter="'check_hidden_l_lower_leg'" name="'LeftLeg'"/>
			<constraint enabled="false" filter="'check_hidden_r_lower_leg'" name="'RightLeg'"/>
			<constraint enabled="false" filter="'check_hidden_l_lower_arm'" name="'LeftForeArm'"/>
			<constraint enabled="false" filter="'check_hidden_r_lower_arm'" name="'RightForeArm'"/>
			<constraint enabled="false" filter="'check_hidden_l_upper_arm'" name="'LeftArm'"/>
			<constraint enabled="false" filter="'check_hidden_r_upper_arm'" name="'RightArm'"/>
			<constraint enabled="false" filter="'check_hidden_head'" name="'Head'"/>
		</sequence>

		<sequence editable_state="true" name="'death'" triggable="true">
			<run_sequence filter="'check_not_halloween_not_gasmask'" name="'spawn_helmet'"/>
			<graphic_group filter="'check_not_halloween_not_gasmask'" name="'hat_grp'" visibility="false"/>
			<body enabled="false" name="'hit_Head'"/>
			<body enabled="false" name="'hit_Body'"/>
			<body enabled="false" name="'hit_Spine'"/>
			<body enabled="false" name="'hit_Spine1'"/>
			<body enabled="false" name="'hit_Spine2'"/>
			<body enabled="false" name="'hit_RightUpLeg'"/>
			<body enabled="false" name="'hit_LeftUpLeg'"/>
			<body enabled="false" name="'hit_RightArm'"/>
			<body enabled="false" name="'hit_LeftArm'"/>
			<body enabled="false" name="'hit_RightForeArm'"/>
			<body enabled="false" name="'hit_LeftForeArm'"/>
			<body enabled="false" name="'hit_RightLeg'"/>
			<body enabled="false" name="'hit_LeftLeg'"/>
		</sequence>		
	</table>
	
	<table search="unit/body;name=[['hit_helmet']]/endurance/run_sequence;name=[['spawn_helmet']]" mode="set_values">
		<table filter="'check_not_halloween_not_gasmask'" start_time="null"/>	
	</table>
	
</table>